package org.eclipse.epsilon.emc.rdbms.iModel;

	import java.util.HashMap;

	public class DBReflexiveModelElement 
	{
		//This is the constructor the type is the tablename and the HaspMap contains the Data mapped to the PK of the table.
		protected String type = "";   //This is the name of the table
		protected HashMap<String, Object> props = new HashMap<String, Object>();  //This stores the mapping between the tablename_PK_Column and the value entered into the hashmap
		
		public DBReflexiveModelElement (String type) {
			super();
			this.type = type;
			System.out.println("Created new model element called ".concat(type));
		}

		public void setType(String type) 
		{
			System.out.println("Set Type Called in ModelElement");
			this.type = type;
		}
		
		public String getType() 
		{
			System.out.println("The Type of the Object is ".concat(type));
			return type;
		}
		
		public HashMap<String, Object> getProps() {
			System.out.println("getProps() called in ModelElement");
			return props;
		}
		
		public DBReflexiveModelElement put(String name, Object value) 
		{
			System.out.println("put called in model element");
			if(value==null)
			{
				value="";
			}
			props.put(name, value);
			return this;
		}
		
		@Override
		public String toString() 
		{
			return "Object of type " + type;
		}
}


